package com.mlk.engSystem.controller;

import com.mlk.core.component.page.Pager;
import com.mlk.core.util.ServerResponse;
import com.mlk.engSystem.po.EngPicBase;
import com.mlk.engSystem.service.EngPicBaseService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * 图库维护
 */
@RequestMapping("/eng/pic/base")
@Controller
public class EngPicBaseController {

    @Resource
    private EngPicBaseService engPicBaseService;

    /**
     * 返回图库首页
     * @return
     */
    @RequestMapping("index")
    public String index(){
        return "picBase/pic";
    }

    /**
     * 分页数据展示
     * @return
     */
    @RequestMapping("listPage")
    @ResponseBody
    public Pager listPage(EngPicBase base){
        return  this.engPicBaseService.listPage(base);
    }

    /**
     * 删除
     * @return
     */
    @RequestMapping("del")
    @ResponseBody
    public ServerResponse del(Integer id){
        return this.engPicBaseService.del(id);
    }

    /**
     * 查看图片
     * @return
     */
    @RequestMapping("lookPic")
    @ResponseBody
    public ServerResponse lookPic(String uniCode){
        return  this.engPicBaseService.lookPic(uniCode);
    }

    /**
     * 更新
     */
    @RequestMapping("updateEngPicBase")
    @ResponseBody
    public ServerResponse updateEngPicBase(EngPicBase engPicBase){
        return this.engPicBaseService.updateEngPicBase(engPicBase);
    }
}
